

<table class="list">
        <tr>
           <th style="width: 150px;">หมวด</th>
            <th style="width: 80px;">จำนวนลงทะเบียนวัสดุ</th>
             <th style="width: 80px;">จำนวนลงทะเบียนครุถัณฑ์</th>
             <th style="width: 80px;">จำนวนความต้องการวัสดุ</th>
		   <th style="width: 80px;">จำนวนความต้องการครุภัณฑ์</th>
		   <th style="width: 80px;">งานแจ้งซ่อมใหม่</th>
		   <th style="width: 80px;">งานแจ้งซ่อมกำลังดำเนินการ</th>
		   <th style="width: 80px;">งานแจ้งซ่อมเสร็จแล้ว</th>
		
		<th style="width: 80px;">จำหน่าย</th>
		  
			
          </tr>
         <?php 
         $i = 1;
         $registed_m1_total = 0 ;
         $registed_m2_total = 0;
         $registed_m2_total = 0;
         $mr1_total = 0;
         $mr2_total = 0;
         $mh_request_total = 0;
         $mh_process_total = 0;
         $mh_finish_total = 0;
         $export_m2_total = 0;
         
         
         foreach($rows as $row){

         $registed_m1_total += $row["registed_m1_total"] ;
         $registed_m2_total += $row["registed_m2_total"];
         $registed_m2_total += $row["registed_m2_total"];
         $mr1_total += $row["mr1_total"];
         $mr2_total += $row["mr2_total"];
         $mh_request_total += $row["mh_request_total"];
         $mh_process_total += $row["mh_process_total"];
         $mh_finish_total +=$row["mh_finish_total"];
         $export_m2_total += $row["export_m2_total"];
         	
         	?>
          
          <tr class="<?php if($i++%2){ echo "even";} ?>" >
          <td class="tdlabel"><span><?php echo $row['category_name']; ?></span></td>
            <td><span><?php echo $row['registed_m1_total']; ?></span></td>
            <td><span><?php echo $row['registed_m2_total']; ?></span></td>
            <td><span><?php echo $row['mr1_total']; ?></span></td>
            <td><span><?php echo $row['mr2_total']; ?></span></td>
            
             <td><span><?php echo $row['mh_request_total']; ?></span></td>
             <td><span><?php echo $row['mh_process_total']; ?></span></td>
            <td><span><?php echo $row['mh_finish_total']; ?></span></td>
                   
                   <td><span><?php echo $row['export_m2_total']; ?></span></td>
                    
            
         
          </tr>
          <?php } ?>
          
          <tr class="<?php if($i++%2){ echo "even";} ?>" >
          <td class="tdlabel"><span>Total</span></td>
            <td class="tdtotal"><span><?php echo $registed_m1_total; ?></span></td>
            <td class="tdtotal"><span><?php echo $registed_m2_total; ?></span></td>
            <td class="tdtotal"><span><?php echo $mr1_total; ?></span></td>
            <td class="tdtotal"><span><?php echo $mr2_total; ?></span></td>
            
             <td class="tdtotal"><span><?php echo $mh_request_total; ?></span></td>
             <td class="tdtotal"><span><?php echo $mh_process_total; ?></span></td>
            <td class="tdtotal"><span><?php echo $mh_finish_total; ?></span></td>
                   
                   <td class="tdtotal"><span><?php echo $row['export_m2_total']; ?></span></td>
                    
            
         
          </tr>
        </table>
        <?php echo $paging; ?>
        
        
        <style>
        
       
        #content table.list  td, #content table.list th {
         text-align: center;
         border-right: 1px solid #ccc;
        
        }
          #content table.list  td.tdtotal
          {
          	  text-align: center;
          	  background-color: #ddd;
          }
        </style>
